import { GET, POST, DELETE, PUT } from '@/web/common/api/requests';
import type { AppSchema } from '@/types/mongoSchema';
import type { AppListItemType, AppUpdateParams } from '@/types/app';
import { RequestPaging } from '@/types/index';
import { addDays } from 'date-fns';
import type { GetAppChatLogsParams } from '@/global/core/api/appReq.d';
import type { CreateAppParams } from '@/types/app';
import type { EditApiKeyPropss } from '@/global/support/api/openapiReq.d';
import { da } from 'date-fns/locale';

// =================== 获取渠道
//登录
export const logins=(data:object)=>POST<string>('/user/login',data);
export const getOpenApiKeys = (page: number) => GET(`/channel/?p=${page}`);

export const delOpenApiById = (id: string) => DELETE(`/channel/${id}`);
// 创建渠道

export const createAOpenApiKey = (data: EditApiKeyPropss) => POST<string>('/channel', data);
//测试渠道
export const testOpenApiByIds = (id: string) => GET(`/channel/test/${id}`);
export const disableOpenApiByIds = (data: object) => PUT<string>('/channel/', data);
